<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%--<link rel="stylesheet" href="<c:url value='/css/joint.all.css'/>" />
<link rel="stylesheet" href="<c:url value='/css/edit_aadl.css'/>" />
 <link href="<c:url value='/css/bootstrap-responsive.min.css'/>" rel="stylesheet"> 
<link rel="stylesheet" href="<c:url value='/css/shou.css'/>" />--%>
<!--<script src="<c:url value='/js/joint.all.js'/>"></script>
<script src="<c:url value='/js/joint.shapes.devs.js'/>"></script>
<script src="<c:url value='/js/devs.js'/>"></script>-->
<div class="page-header">
	<h3 style="margin-top: auto">
	<c:choose>
		<c:when test="${!empty project}">
			编辑系统架构实例:<a href="javascript:void(0);"><c:out value="${project.name}"/></a>
		</c:when>
		<c:otherwise>
			编辑系统架构模板
		</c:otherwise>
	</c:choose>
		
		<button class="btn btn-small"
			style="float: right; margin-right: 30px; margin-top: 10px;"
			onclick="goback()">
			<i class="icon-arrow-left"></i>&nbsp;返回
		</button>
	</h3>
</div>
<div class="row-fluid">
	<c:if test="${!empty logerList}">
	<div class="accordion" id="accordion2">
  		<div class="accordion-group">
    		<div class="accordion-heading">
      			<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseOne">
        			更新日志
      			</a>
    		</div>
    		<div id="collapseOne" class="accordion-body collapse in">
      			<div class="accordion-inner">
        			<c:forEach items="${logerList}" var="loger" varStatus="s">
								<c:out value="${s.count}" />、
								&nbsp;时间：<c:out value="${1900+loger.time.getYear()}" />-<c:out value="${1+loger.time.getMonth()}" />-<c:out value="${1+loger.time.getDay()}" />
								&nbsp;更新者：<c:out value="${loger.operator.realname}" />
								<br/>
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;日志内容：<c:out value="${loger.logInfo}" />
								<br/>
					</c:forEach>
      			</div>
    		</div>
  		</div>
	</div>
	</c:if>
	<div id="org" class="content-container">
		<div id="paper" class="paper"></div>
	</div>
</div>
<!--/span-->
<div class="clearfix">
	<div class="float-open" id="float-open" style="left: 95%;">
		<a class="open-btn" href="javascript:void(0);">&gt;</a>
	</div>
	<div class="float-news" id="float-news" style="left: 79%;">
		<a class="float-close" href="javascript:void(0);">X</a>
		<div>
			<div id="operation_div" style="margin-left: 10px">
				<p>
					<a onclick="showOperation()" class="myanchor"><img
						id="operation_img"
						src="<c:url value='/img/app/horizontal_flow.png'/>" class="myicon">操作</a>
				</p>
				<ul class="nav nav-list" id="operation_ul">
					<li id="select_li"><a onclick="goToNormal()"><img
							src="<c:url value='/img/aadl/select.png'/>" class="myicon">select</a></li>
					<li id="zoomin_li"><a onclick="zoomIn()"><img
							src="<c:url value='/img/aadl/zoom-in.png'/>" class="myicon">放大</a></li>
					<li id="zoomout_li"><a onclick="zoomOut()"><img
							src="<c:url value='/img/aadl/zoom-out.png'/>" class="myicon">缩小</a></li>
					<li id="delete_li"><a onclick="deleteObject()"><img
							src="<c:url value='/img/app/delete_object.png'/>" class="myicon">删除model</a></li>
					<li id="link_li"><a onclick="addLink()"><img
							src="<c:url value='/img/app/UMLAssociation.png'/>" class="myicon">建立connection</a></li>
					<li id="properties_li"><a onclick="editProperty()"><img
							src="<c:url value='/img/aadl/properties.png'/>" class="myicon">编辑Properties</a></li>
					<li id="features_li"><a onclick="editFeatures()"><img
							src="<c:url value='/img/aadl/edit.png'/>" class="myicon">编辑Features</a></li>
					<li id="down_li"><a onclick="editDown()"><img
							src="<c:url value='/img/aadl/edit_down.png'/>" class="myicon">编辑子图</a></li>
					<li id="bind_li"><a onclick="editBind()"><img
							src="<c:url value='/img/aadl/bind_cpu.png'/>" class="myicon">绑定硬件</a></li>
				</ul>
			</div>
			<div id="type_div" style="margin-left: 10px">
				<p>
					<a onclick="showType()" class="myanchor"><img id="type_img"
						src="<c:url value='/img/app/horizontal_flow.png'/>" class="myicon">Types</a>
				</p>
				<ul class="nav nav-list" id="type_ul">
					<li id="system_li"><a onclick="addSystem()"><img
							src="<c:url value='/img/aadl/system.png'/>" class="myicon">System</a></li>
					<li id="device_li"><a onclick="addDevice()"><img
							src="<c:url value='/img/aadl/device.png'/>" class="myicon">Device</a></li>
					<li id="bus_li"><a onclick="addBus(this)"><img
							src="<c:url value='/img/aadl/bus.png'/>" class="myicon">Bus</a></li>
					<li id="memory_li"><a onclick="addMemory()"><img
							src="<c:url value='/img/aadl/memory.png'/>" class="myicon">Memory</a></li>
					<li id="processor_li"><a onclick="addProcessor()"><img
							src="<c:url value='/img/aadl/processor.png'/>" class="myicon">Processor</a></li>
					<li id="process_li"><a onclick="addProcess()"><img
							src="<c:url value='/img/aadl/process.png'/>" class="myicon">Process</a></li>
					<li id="thread_li"><a onclick="addThread()"><img
							src="<c:url value='/img/aadl/thread.png'/>" class="myicon">Thread</a></li>
					<li id="data_li"><a onclick="addData()"><img
							src="<c:url value='/img/aadl/data.png'/>" class="myicon">Data</a></li>
					<li id="subprogram_li"><a onclick="addSubprogram()"><img
							src="<c:url value='/img/aadl/subprogram.png'/>" class="myicon">Subprogram</a></li>
					<li id="threadgroup_li"><a onclick="addThreadGroup()"><img
							src="<c:url value='/img/aadl/threadgroup.png'/>" class="myicon">ThreadGroup</a></li>
				</ul>
			</div>
			<div id="feature_div" style="margin-left: 10px">
				<p>
					<a onclick="showFeature()" class="myanchor"><img
						id="feature_img"
						src="<c:url value='/img/app/horizontal_flow.png'/>" class="myicon">Features</a>
				</p>
				<ul class="nav nav-list" id="feature_ul">
					<li><a><img
							src="<c:url value='/img/aadl/in_data_port.png'/>" class="myicon"><span
							id="port">In Data Port</span></a></li>
					<li><a><img
							src="<c:url value='/img/aadl/out_data_port.png'/>" class="myicon"><span
							id="port">Out Data Port</span></a></li>
					<li><a><img
							src="<c:url value='/img/aadl/inout_data_port.png'/>"
							class="myicon"><span id="port">InOut Data Port</span></a></li>
					<li><a><img
							src="<c:url value='/img/aadl/in_event_port.png'/>" class="myicon"><span
							id="port">In Event Port</span></a></li>
					<li><a><img
							src="<c:url value='/img/aadl/out_event_port.png'/>"
							class="myicon"><span id="port">Out Event Port</span></a></li>
					<li><a><img
							src="<c:url value='/img/aadl/inout_event_port.png'/>"
							class="myicon"><span id="port">InOut Event Port</span></a></li>
					<li><a><img
							src="<c:url value='/img/aadl/in_dataevent_port.png'/>"
							class="myicon"><span id="port">In DataEvent Port</span></a></li>
					<li><a><img
							src="<c:url value='/img/aadl/out_dataevent_port.png'/>"
							class="myicon"><span id="port">Out DataEvent Port</span></a></li>
					<li><a><img
							src="<c:url value='/img/aadl/inout_dataevent_port.png'/>"
							class="myicon"><span id="port">InOut DataEvent Port</span></a></li>
					<li><a><img
							src="<c:url value='/img/aadl/require_data.png'/>" class="myicon"><span
							id="port">Requires Data Access</span></a></li>
					<li><a><img
							src="<c:url value='/img/aadl/provide_data.png'/>" class="myicon"><span
							id="port">Provides Data Access</span></a></li>
					<li><a><img
							src="<c:url value='/img/aadl/require_bus.png'/>" class="myicon"><span
							id="port">Requires Bus Access</span></a></li>
					<li><a><img
							src="<c:url value='/img/aadl/provide_bus.png'/>" class="myicon"><span
							id="port">Provides Bus Access</span></a></li>
				</ul>
			</div>
			<button type="button" class="btn" id="btn_submit"
				style="width: 150px; margin-top: 20px; margin-bottom: 5px; margin-left: 20px"
				onclick="submitAADL(projectId,opertype,uri,'${templateName}','${templateDes}','${templateGroup}')">
				<i class="icon-ok"></i>&nbsp;提交
			</button>
			<!--/.well -->
		</div>
	</div>
</div>

<!-- System Modal -->
<div id="systemModal" class="modal hide fade" tabindex="-1"
	role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal"
			aria-hidden="true" onclick="goToNormal()">×</button>
		<h3 id="systemLabel">System</h3>
	</div>
	<div class="modal-body">
		<div class="control-group">
			<label class="control-label"></label>
			<div class="controls">
				<div class="btn-group" data-toggle="buttons-radio">
					<button type="button" id="btn_main_system"
						onclick="click_main_system()">主系统</button>
					<button type="button" id="btn_inner_system"
						onclick="click_inner_system()">内部系统</button>
				</div>
			</div>
		</div>
		<div id="div_system_name">
			<p>
				<input type="text" placeholder="System名称" id="system_name"
					name="system_name"> <span class="help-inline"
					id="help_system_name">英文</span>
			</p>
		</div>
		<div id="div_inner_system">
			<div id="div_inner_system_input">
				<p>
					<input type="text" placeholder="内部System名称" id="system_name_inner"
						name="system_name_inner"> <span class="help-inline"
						id="help_system_name_inner">英文</span>
				</p>
			</div>
			<p>
				<label class="checkbox"> <input type="checkbox"
					name="isMainInnerSystem" id="isMainInnerSystem">是否作为内部主系统
				</label>
			</p>
		</div>
	</div>
	<div class="modal-footer">
		<button class="btn" data-dismiss="modal" aria-hidden="true"
			onclick="goToNormal()">
			<i class="icon-remove"></i>&nbsp;关闭
		</button>
		<button class="btn" onclick="confirmSystemName()">
			<i class="icon-ok"></i>&nbsp;确定
		</button>
	</div>
</div>

<!-- Element Name Modal -->
<div id="elementModal" class="modal hide fade" tabindex="-1"
	role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal"
			aria-hidden="true" onclick="goToNormal()">×</button>
		<h3 id="elementLabel">System</h3>
	</div>
	<div class="modal-body">

		<div id="div_element_name">
			<p>

				<input type="text" placeholder="Type名称" id="element_name"
					name="element_name"> <span class="help-inline"
					id="help_element_name">英文</span>
			</p>
		</div>
	</div>
	<div class="modal-footer">
		<button class="btn" data-dismiss="modal" aria-hidden="true"
			onclick="goToNormal()">
			<i class="icon-remove"></i>&nbsp;关闭
		</button>
		<button class="btn" onclick="confirmElementName()">
			<i class="icon-ok"></i>&nbsp;确定
		</button>
	</div>
</div>

<!-- Port Modal -->
<div id="portModal" class="modal hide fade" tabindex="-1" role="dialog"
	aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal"
			aria-hidden="true" onclick="goToNormal()">×</button>
		<h3 id="myModalLabel">Feature</h3>
	</div>
	<div class="modal-body">

		<div id="div_feature_name">
			<p>
				<input type="text" placeholder="名称" id="port_name" name="port_name">
				<span class="help-inline" id="help_port_name">英文</span>
			</p>
		</div>
	</div>
	<div class="modal-footer">
		<button class="btn" data-dismiss="modal" aria-hidden="true"
			onclick="goToNormal()">
			<i class="icon-remove"></i>&nbsp;关闭
		</button>
		<button class="btn" onclick="addPort()">
			<i class="icon-ok"></i>&nbsp;确定
		</button>
	</div>
</div>

<!-- Device Modal -->
<div id="deviceModal" class="modal hide fade" tabindex="-1"
	role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal"
			aria-hidden="true" onclick="goToNormal()">×</button>
		<h3 id="myModalLabel">Device</h3>
	</div>
	<div class="modal-body">
		<div class="control-group">
			<label class="control-label"></label>
			<div class="controls">
				<div class="btn-group" data-toggle="buttons-radio">
					<button type="button" class="btn" id="btn_outer_system"
						onclick="click_outer_device()">外部设备</button>
					<button type="button" class="btn" id="btn_device_list"
						onclick="click_inner_device()">内部设备</button>
					<button type="button" class="btn" id="btn_device_else"
						onclick="click_device_else()">其他</button>
				</div>
			</div>
		</div>
		<div id="div_outter_device_list">
			<table class="table table-hover" id="outter_device_list">
				<thead>
					<tr>
						<th style="width: 20%">选择</th>
						<th style="width: 20%">编号</th>
						<th style="width: 30%">名称</th>
						<th style="width: 30%">中文名称</th>
					</tr>
				</thead>
				<tbody>
					<c:choose>
						<c:when test="${!empty outterDevices}">
							<c:forEach items="${outterDevices}" var="list" varStatus="s">
								<tr>
									<td id="td_id"><input type="radio" name="optionsRadios"
										id="optionsRadios" value="${list.id}"></td>
									<td><c:out value="${s.count}" /></td>
									<td id="td_name"><c:out value="${list.name}" /></td>
									<td id="td_cnname"><c:out value="${list.cnName}" /></td>
								</tr>

							</c:forEach>
						</c:when>
						<c:otherwise>
							<h3 style="margin-top: auto">数据库暂无相关外部设备信息</h3>
						</c:otherwise>
					</c:choose>
				</tbody>
			</table>
		</div>
		<div id="div_inner_device_list">
			<table class="table table-hover" id="device_list">
				<thead>
					<tr>
						<th style="width: 20%">选择</th>
						<th style="width: 20%">编号</th>
						<th style="width: 30%">名称</th>
						<th style="width: 30%">中文名称</th>

					</tr>
				</thead>
				<tbody>
					<c:choose>
						<c:when test="${!empty innerDevices}">
							<c:forEach items="${innerDevices}" var="list" varStatus="s">
								<tr>
									<td id="td_id"><input type="radio" name="optionsRadios"
										id="optionsRadios" value="${list.id}"></td>
									<td><c:out value="${s.count}" /></td>
									<td id="td_name"><c:out value="${list.name}" /></td>
									<td id="td_cnname"><c:out value="${list.cnName}" /></td>
								</tr>

							</c:forEach>
						</c:when>
						<c:otherwise>
							<h3 style="margin-top: auto">数据库暂无相关内部设备信息</h3>
						</c:otherwise>
					</c:choose>
				</tbody>
			</table>
		</div>
		<div id="div_device_else">
			<p>
				<input type="text" placeholder="device名称" id="device_name"
					name="device_name"> <span class="help-inline"
					id="help_device_name">英文</span>
			</p>
		</div>
	</div>
	<div class="modal-footer">
		<button class="btn" data-dismiss="modal" aria-hidden="true"
			onclick="goToNormal()">
			<i class="icon-remove"></i>&nbsp;关闭
		</button>
		<button class="btn" onclick="selectDevice()">
			<i class="icon-ok"></i>&nbsp;确定
		</button>
	</div>
</div>

<!-- SubProgram Modal -->
<div id="subprogramModal" class="modal hide fade" tabindex="-1"
	role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal"
			aria-hidden="true" onclick="goToNormal()">×</button>
		<h3 id="myModalLabel">SubProgram</h3>
	</div>
	<div class="modal-body">
		<div class="tabbable"> <!-- Only required for left/right tabs -->
  			<ul class="nav nav-tabs">
    			<li class="active"><a href="#tab1" data-toggle="tab" onclick="selectAgentSubprogram()">代理列表</a></li>
    			<li><a href="#tab2" data-toggle="tab" onclick="selectOtherSubprogram()">其他</a></li>
  			</ul>
  			<div class="tab-content">
    			<div class="tab-pane active" id="tab1">
    				<c:choose>
						<c:when test="${!empty agentList and !empty project}">
		    				<table class="table table-hover" id="agent_list">
								<thead>
									<tr>
										<th style="width: 20%">选择</th>
										<th style="width: 20%">编号</th>
										<th style="width: 30%">名称</th>
										<th style="width: 30%">类型</th>
									</tr>
								</thead>
								<tbody>
									<c:forEach items="${agentList}" var="list" varStatus="s">
										<tr>
											<td id="td_id"><input type="radio" name="agentOptionsRadios"
												id="agentOptionsRadios" value="${list.id}"></td>
											<td><c:out value="${s.count}" /></td>
											<td id="td_name"><c:out value="${list.name}" /></td>
											<td id="td_type">
											<c:choose>
												<c:when test="${list.type.equals('bus')}">
												总线通信
												</c:when>
												<c:when test="${list.type.equals('control')}">
												控制响应
												</c:when>
												<c:when test="${list.type.equals('display')}">
												信息显示
												</c:when>
											</c:choose>
											</td>
										</tr>
									</c:forEach>
								</tbody>
							</table>
						</c:when>
						<c:when test="${empty agentList and !empty project}">
							<h3 style="margin-top: auto">尚未上传Rhapsody模型</h3>
						</c:when>
						<c:otherwise>
							<h3 style="margin-top: auto">架构模板无相关代理信息</h3>
						</c:otherwise>
					</c:choose>
    			</div>
    			<div class="tab-pane" id="tab2">
    				<div class="control-group">
						<label class="control-label"></label>
						<div class="controls">
							<div class="btn-group" data-toggle="buttons-radio">
								<button type="button" class="btn" id="btn_bus_read"
									onclick="click_bus_read()">总线通信（读）</button>
								<button type="button" class="btn" id="btn_bus_write"
									onclick="click_bus_write()">总线通信（写）</button>
								<button type="button" class="btn" id="btn_info_display"
									onclick="click_info_display()">信息显示</button>
								<button type="button" class="btn" id="btn_control_react"
									onclick="click_control_react()">控制响应</button>
							</div>
						</div>
					</div>
					<div id="div_subprogram_name">
						<p>
						<span class="help-inline" id="help_subprogram_type">英文</span> <input
							type="text" placeholder="subprogram名称" id="subprogram_name"
							name="subprogram_name"> <span class="help-inline"
							id="help_subprogram_name">英文</span>
						</p>
					</div>
    			</div>
  			</div>
		</div>
	</div>
	<div class="modal-footer">
		<button class="btn" data-dismiss="modal" aria-hidden="true"
			onclick="goToNormal()">
			<i class="icon-remove"></i>&nbsp;关闭
		</button>
		<button class="btn" onclick="selectSubprogram()">
			<i class="icon-ok"></i>&nbsp;确定
		</button>
	</div>
</div>

<!-- Bus Modal -->
<div id="busModal" class="modal hide fade" tabindex="-1" role="dialog"
	aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal"
			aria-hidden="true" onclick="goToNormal()">×</button>
		<h3 id="myModalLabel">Bus</h3>
	</div>
	<div class="modal-body">
		<table class="table table-hover" id="bus_list">
			<thead>
				<tr>
					<th style="width: 20%">选择</th>
					<th style="width: 20%">编号</th>
					<th style="width: 30%">名称</th>
					<th style="width: 30%">中文名称</th>
				</tr>
			</thead>
			<tbody>
				<c:choose>
					<c:when test="${!empty buses}">
						<c:forEach items="${buses}" var="list" varStatus="s">
							<tr>
								<td id="td_id"><input type="radio" name="optionsRadios"
									id="optionsRadios" value="${list.id}"></td>
								<td><c:out value="${s.count}" /></td>
								<td id="td_name"><c:out value="${list.name}" /></td>
								<td id="td_cnname"><c:out value="${list.cnName}" /></td>
							</tr>

						</c:forEach>
					</c:when>
					<c:otherwise>
						<h3 style="margin-top: auto">数据库暂无相关总线信息</h3>
					</c:otherwise>
				</c:choose>
			</tbody>
		</table>
	</div>
	<div class="modal-footer">
		<button class="btn" data-dismiss="modal" aria-hidden="true"
			onclick="goToNormal()">
			<i class="icon-remove"></i>&nbsp;关闭
		</button>
		<button class="btn" onclick="selectBus()">
			<i class="icon-ok"></i>&nbsp;确定
		</button>
	</div>
</div>
<!-- Select Port Modal -->
<div id="selectModal" class="modal hide fade" tabindex="-1"
	role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal"
			aria-hidden="true" onclick="goToNormal()">×</button>
		<h3 id="portModalLabel">选择端口</h3>
	</div>
	<div class="modal-body">
		<table class="table table-hover" id="port_list">
			<thead>
				<tr>
					<th style="width: 20%">选择</th>
					<th style="width: 40%">名称</th>
					<th style="width: 40%">类型</th>
				</tr>
			</thead>
			<tbody>
			</tbody>
		</table>
	</div>
	<div class="modal-footer">
		<button class="btn" data-dismiss="modal" aria-hidden="true"
			onclick="goToNormal()">
			<i class="icon-remove"></i>&nbsp;关闭
		</button>
		<button class="btn" onclick="selectPort()">
			<i class="icon-ok"></i>&nbsp;确定
		</button>
	</div>
</div>
<!-- Tip Modal -->
<div id="tipModal" class="modal hide fade" tabindex="-1" role="dialog"
	aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal"
			aria-hidden="true">×</button>
		<h3 id="portModalLabel">错误提示</h3>
	</div>
	<div class="modal-body">
		<p>
			<span class="help-inline" id="help_tip"></span>
		</p>
	</div>
	<div class="modal-footer">
		<button class="btn" data-dismiss="modal" aria-hidden="true">
			<i class="icon-remove"></i>&nbsp;关闭
		</button>
		<button class="btn" data-dismiss="modal" aria-hidden="true">
			<i class="icon-ok"></i>&nbsp;确定
		</button>
	</div>
</div>

<!-- Edit Property Modal -->
<div id="propertyModal" class="modal hide fade" tabindex="-1"
	role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal"
			aria-hidden="true" onclick="goToNormal()">×</button>
		<h3 id="propertyModalLabel">编辑Property</h3>
	</div>
	<div class="modal-body">
		<table class="table table-hover" id="property_list">
			<thead>
				<tr>
					<th style="width: 20%">选择</th>
					<th style="width: 40%">名称</th>
					<th style="width: 40%">值</th>
				</tr>
			</thead>
			<tbody>
			</tbody>
		</table>
		<div id="div_property_name">
			<p>
				<input type="text" placeholder="名称" id="property_name"
					name="property_name"><span class="help-inline"
					id="help_property_name">英文</span>
			</p>
			<p>
				<input type="text" placeholder="值" id="property_value"
					name="property_value">
				<button style="margin-left: 50px; margin-bottom: 8px" class="btn"
					onclick="addProperty()">
					<i class="icon-plus"></i>&nbsp;添加
				</button>
			</p>
		</div>
	</div>
	<div class="modal-footer">
		<button class="btn" data-dismiss="modal" aria-hidden="true"
			onclick="goToNormal()">
			<i class="icon-remove"></i>&nbsp;关闭
		</button>
		<button class="btn" onclick="saveProperty()">
			<i class="icon-ok"></i>&nbsp;确定
		</button>
	</div>
</div>

<div id="bindModal" class="modal hide fade" tabindex="-1" role="dialog"
	aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal"
			aria-hidden="true" onclick="goToNormal()">×</button>
		<h3 id="bindModalLabel">绑定硬件</h3>
	</div>
	<div class="modal-body">
		<div id="div_bind_processor">
			<p>
				<span class="help-inline">Allowed_Processor_Binding =>
					reference</span> <input type="text" placeholder="Processor名称"
					id="processor_name" name="processor_name"><span
					class="help-inline" id="help_processor_name"></span>
			</p>
		</div>
	</div>
	<div class="modal-footer">
		<button class="btn" data-dismiss="modal" aria-hidden="true"
			onclick="goToNormal()">
			<i class="icon-remove"></i>&nbsp;关闭
		</button>
		<button class="btn" onclick="saveBind()">
			<i class="icon-ok"></i>&nbsp;确定
		</button>
	</div>
</div>


<!-- AADL Template Modal -->
<div id="templateModal" class="modal hide fade" tabindex="-1"
	role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"
	style="width: 600px;">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal"
			aria-hidden="true" onclick="goToNormal()">×</button>
		<h3>定义架构模板</h3>
	</div>
	<div class="modal-body">
		<div class="control-group" id="div_template_radio">
			<label class="control-label"></label>
			<div class="controls">
				<div class="btn-group" data-toggle="buttons-radio">
					<button type="button" class="btn" id="btn_template_no"
						onclick="click_template_no()">否(默认)</button>
					<button type="button" class="btn" id="btn_template_yes"
						onclick="click_template_yes()">是</button>
				</div>
			</div>
		</div>
		<div id="div_template_info">
			<div>
				<div id="div_template_name">
					<label class="control-label">模板名称</label>
					<div>
						<input type="text" class="input-xlarge" placeholder="模板名称"
							id="template_name" name="template_name">
					</div>
				</div>
				<div>
					<label class="control-label">模板所属项目类别</label>
					<div>
					<select style="width: 200px" id="groupid" name="groupid" class="selector">
						<option value="0"></option>
						<c:choose>
							<c:when test="${!empty groups}">
								<c:forEach items="${groups}" var="list" varStatus="s">
									<option value="${list.id}">${list.name}</option>
								</c:forEach>
							</c:when>
						</c:choose>
					</select>
					</div>
				</div>
				<div>
					<label class="control-label">模板描述信息</label>
					<div>
						<textarea rows="3" class="input-xxlarge" placeholder="模板描述信息"
							id="template_description" name="template_description"></textarea>
					</div>
				</div>
				<div id="div_template_loger">
				<label class="control-label">更新日志</label>
					<div>
					<textarea rows="4" class="input-xxlarge" placeholder="请输入本次更新的相关内容"
							id="template_loger_info"></textarea>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div class="modal-footer">
		<button class="btn" data-dismiss="modal" aria-hidden="true"
			onclick="goToNormal()">
			<i class="icon-remove"></i>&nbsp;关闭
		</button>
		<button class="btn"
			onclick="submitAADLTemplate(projectId,opertype,uri)">
			<i class="icon-ok"></i>&nbsp;确定
		</button>
	</div>
</div>
<!-- AADL Loger Modal -->
<div id="logerModal" class="modal hide fade" tabindex="-1"
	role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"
	style="width: 600px;">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal"
			aria-hidden="true" onclick="goToNormal()">×</button>
		<h3>更新日志</h3>
	</div>
	<div class="modal-body">
		<div id="div_model_loger">
			<textarea rows="4" class="input-xxlarge" placeholder="请输入本次更新的相关内容"
							id="loger_info" name="loger_info"></textarea>
		</div>
	</div>
	<div class="modal-footer">
		<button class="btn" data-dismiss="modal" aria-hidden="true"
			onclick="goToNormal()">
			<i class="icon-remove"></i>&nbsp;关闭
		</button>
		<button class="btn"
			onclick="submitAADLModelUpdate(projectId,opertype,uri)">
			<i class="icon-ok"></i>&nbsp;确定
		</button>
	</div>
</div>
<!--/row-->
<link rel="stylesheet" href="css/joint.all.css" />
<link rel="stylesheet" href="css/edit_aadl.css" />
<link rel="stylesheet" href="css/shou.css" />
<script src="js/joint.all.js"></script>
<script src="js/joint.shapes.devs.js"></script>
<script src="js/cdsf_map.js"></script>
<script src="js/devs.js"></script>
<script src="js/edit_aadl.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/jquery.cookie.js"></script>
<script type="text/javascript">
	$(function() {
		$("#operation_ul").hide();
		$("#type_ul").hide();
		$("#feature_ul").hide();
		$("#div_system_name").hide();
		$("#div_inner_system").hide();
		$("#div_inner_device_list").hide();
		$("#div_outter_device_list").hide();
		$("#div_device_else").hide();
		/* $(window).scroll(function(){ 
		    var topValue=$(window).scrollTop()+40; 
		    var leftValue=$(window).scrollLeft();
		    $("#toolBar").offset({top:topValue,left:leftValue}); 
		}); */
	});
	function goback() {
		history.go(-1);
	}
	function ml_close_demo() {
		$('.float-news').animate({
			left : '100%'
		}, 300, function() {
			$('.float-open').delay(50).animate({
				left : '95%'
			}, 300);
		});
	}
	function ml_open_demo() {
		$('.float-open').animate({
			left : '100%'
		}, 100, function() {
			$('.float-news').delay(50).animate({
				left : '79%'
			}, 300);
		});
	}
	var nodeJson = ${nodeJson};
	var linkJson = ${linkJson};
	//var tempName = ;
	//var tempDes = ;
	if (nodeJson != null && nodeJson != "null") {
		parseNode(nodeJson);
	}
	if (linkJson != null && linkJson != "null") {
		parseLink(linkJson);
	}
	var projectId = $.cookie('projectId');
	var opertype = $.cookie('type');
	var uri = $.cookie('uri');
	$('.float-close').click(function() {
		ml_close_demo();
		return false;
	});
	$('.open-btn').click(function() {
		ml_open_demo();
		return false;
	});
	ml_close_demo();
</script>
